package main

import (
    "fmt"
    "os"
    "encoding/gob"
)

type People struct {
    Name string
    Age  int
}

func main() {

    p := People{
        Name: "Jason Yin",
        Age:  18,
    }

    f, err := os.Create("1.gob")
    if err != nil {
        fmt.Println(1111, err)
        return
    }
    defer f.Close()


    encoder := gob.NewEncoder(f)

    err = encoder.Encode(p)
    fmt.Println(22222, err)
    return 
}
